#include <stdio.h>
#include <time.h>

const int N = 9999;
clock_t st, et;
FILE* fp;
int ar[9999];

int main() {
	fp = fopen("../data", "r");
	for (int i = 0; i < N; i++) {
		fscanf(fp, "%d", &ar[i]);
	}
	printf("Read finish!\n");
	st = clock();

	for (int i = 0; i < N - 1; i++) {
		for (int j = 0; j < N - i - 1; j++){
			if (ar[j] > ar[j + 1]) {
				int tm = ar[j];
				ar[j] = ar[j + 1];
				ar[j + 1] = tm;
			}
		}
	}

	et = clock();
	printf("[");
	for (int i = 0; i < N; i++) {
		printf("%d, ", ar[i]);
	}
	printf("]\nTime: %ldms\n", (et - st) / 1000);
	return 0;
}
